﻿using System;
using System.Data.Objects;
using System.Linq;
using Repository;

namespace DataGenerator.DefaultSets
{
    /// <summary>
    /// Event Type Set
    /// </summary>
    public class EventGroupTypeSet : SetBase<EventGroupType>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="EventGroupTypeSet"/> class.
        /// </summary>
        /// <param name="objectSet">The object set.</param>
        public EventGroupTypeSet(ObjectSet<EventGroupType> objectSet)
            : base(objectSet)
        {
        }

        public EventGroupType GroupByPeriod
        {
            get { return Get(() => GroupByPeriod); }
            set { Set(() => GroupByPeriod, value); }
        }

        public EventGroupType Single
        {
            get { return Get(() => Single); }
            set { Set(() => Single, value); }
        }

        public EventGroupType Periodic
        {
            get { return Get(() => Periodic); }
            set { Set(() => Periodic, value); }
        }

        public EventGroupType StudyCourse
        {
            get { return Get(() => StudyCourse); }
            set { Set(() => StudyCourse, value); }
        }

        public EventGroupType Class
        {
            get { return Get(() => Class); }
            set { Set(() => Class, value); }
        }

        public EventGroupType Meeting
        {
            get { return Get(() => Meeting); }
            set { Set(() => Meeting, value); }
        }

        public EventGroupType Examination
        {
            get { return Get(() => Examination); }
            set { Set(() => Examination, value); }
        }

        /// <summary>
        /// Searches the default value.
        /// </summary>
        /// <param name="name">The name.</param>
        /// <returns>Default entity.</returns>
        protected override EventGroupType SearchDefaultValue(string name)
        {
            return ObjectSet.FirstOrDefault(e => e.Name == name);
        }
    }
}
